Aggregation is an important enterprise service bus (ESB) pattern enabling a single inbound request to map into multiple outbound service invocations, the responses from which can be aggregated into a single reply to the original request, all of which may be handled by the ESB. In such design patterns, a common implementation may include invoking multiple synchronous services asynchronously, enabling concurrent processing of the separate invocations to reduce over response time of the solution. This typically involves utilizing a messaging layer to correlate requests and responses and provide a context switch to a separate component to hand the synchronous invocation while the original thread continues with additional concurrent processing.
In the simple case such implementations can help to reduce response times in the aggregation block (the ESB) from the sum of the service invocations (each invoked in turn), to the response time of the longest service invocation (each invoked concurrently). However, invoking a synchronous service asynchronously has additional overheads to invoking the same service synchronously, such as an additional messaging layer and context switch, which drives additional processing costs.